//
//  UIView+Positioning.h
//  CFFinanceProject
//
//  Created by chunfeng on 2018/4/9.
//  Copyright © 2018年 xiaowen. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 UIView分类，使用可直接self.view.x/y/width/height
 */
@interface UIView (Positioning)

/** View's X Position */
@property (nonatomic, assign) CGFloat   x;

/** View's Y Position */
@property (nonatomic, assign) CGFloat   y;

/** View's width */
@property (nonatomic, assign) CGFloat   width;

/** View's height */
@property (nonatomic, assign) CGFloat   height;

/** View's origin - Sets X and Y Positions */
@property (nonatomic, assign) CGPoint   origin;

/** View's size - Sets Width and Height */
@property (nonatomic, assign) CGSize    size;

/** Y value representing the bottom of the view **/
@property (nonatomic, assign) CGFloat   bottom;

/** X Value representing the right side of the view **/
@property (nonatomic, assign) CGFloat   right;

/** X Value representing the top of the view (alias of x) **/
@property (nonatomic, assign) CGFloat   left;

/** Y Value representing the top of the view (alias of y) **/
@property (nonatomic, assign) CGFloat   top;

/** X value of the object's center **/
@property (nonatomic, assign) CGFloat   centerX;

/** Y value of the object's center **/
@property (nonatomic, assign) CGFloat   centerY;

/** Returns the Subview with the heighest X value **/
@property (nonatomic, strong, readonly) UIView *lastSubviewOnX;

/** Returns the Subview with the heighest Y value **/
@property (nonatomic, strong, readonly) UIView *lastSubviewOnY;

/** View's bounds X value **/
@property (nonatomic, assign) CGFloat   boundsX;

/** View's bounds Y value **/
@property (nonatomic, assign) CGFloat   boundsY;

/** View's bounds width **/
@property (nonatomic, assign) CGFloat   boundsWidth;

/** View's bounds height **/
@property (nonatomic, assign) CGFloat   boundsHeight;

/**
 Centers the view to its parent view (if exists)
 */
-(void) centerToParent;



/**
 为视图添加圆角
 
 @param cornerRadius 圆角大小
 */
-(void)addCornerRadius:(CGFloat)cornerRadius;



/**
 为视图控制边框
 
 @param cornerRadius 圆角大小
 @param borderWidth 边框宽度
 @param borderColor 边框颜色
 */
-(void)addCornerRadius:(CGFloat)cornerRadius
           borderWidth:(CGFloat)borderWidth
           borderColor:(UIColor *)borderColor;




/**
 根据shadowOffset,shadowOpacity,shadowRadius和shadowColor为UIVIEW添加阴影.
 
 @param shadowRadius 阴影边框圆角大小
 @param shadowOffset 阴影位置
 @param shadowColor 阴影颜色
 @param shadowOpacity 阴影的透明度
 */
-(void)addShadowRadius:(CGFloat)shadowRadius  shadowOffset:(CGSize)shadowOffset shadowColor:(UIColor *)shadowColor shadowOpacity:(CGFloat)shadowOpacity;

@end
